<template>
  <a-modal
    :visible="visible"
    :title="editId ? '学校校区信息修改' : '新增学校校区'"
    okText='保存'
    :width="700"
    @cancel="() => { $emit('cancel') }"
    @ok="() => { $emit('create') }"
  >
    <a-form :form="form">
      <a-row>
        <a-col :md="10" :sm="24">
          <a-form-item
            label="校区编号"
            :labelCol="{span: 7,offset: 1}"
            :wrapperCol="{span: 15, offset: 1}"
          >
            <a-input v-decorator="[
              'xqbh',
              {
                rules: [{ required: true, message: '请输入校区编号!' }],
              }
            ]"/>
          </a-form-item>
        </a-col>
        <a-col :md="10" :sm="24">
          <a-form-item
            label="校区名称"
            :labelCol="{span: 7,offset: 1}"
            :wrapperCol="{span: 15, offset: 1}"
          >
            <a-input v-decorator="[
              'xqmc',
              {
                rules: [{ required: true, message: '请输入校区名称!' }],
              }
            ]"/>
          </a-form-item>
        </a-col>
      </a-row>
      <a-form-item label="备注" :labelCol="{span: 2,offset: 2}" :wrapperCol="{span: 16}">
        <a-input type="textarea" v-decorator="['note']" :autosize="{ minRows: 2, maxRows: 6 }"/>
      </a-form-item>
    </a-form>
  </a-modal>
</template>

<script>
export default {
  props: ['visible', 'editId'],
  beforeCreate () {
    this.form = this.$form.createForm(this)
  }
}
</script>

<style>

</style>
